Use "Home" rather than "Username's Home" (#125964).
authorFederico Mena Quintero <federico@ximian.com>
Wed, 10 Dec 2003 03:46:30 +0000 (03:46 +0000)
committerFederico Mena Quintero <federico@src.gnome.org>
Wed, 10 Dec 2003 03:46:30 +0000 (03:46 +0000)
2003-12-09  Federico Mena Quintero  <federico@ximian.com>

* gtk/gtkfilechooserdefault.c (shortcuts_append_home): Use "Home"
rather than "Username's Home" (#125964).
(shortcuts_selection_changed_cb): New callback, check the
sensitivity of the Remove Bookmark button at the right time.
(shortcuts_row_activated_cb): It is not necessary to check the
sensitivity here.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
docs/reference/gtk/migrating-GtkFileChooser.sgml
gtk/gtkfilechooserdefault.c

index e854fc25a518040c44bc2289bc7ccb93f4da4d76..7b4735dbf9bd00c2855647f6ddb7187928fc704c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2003-12-09  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (shortcuts_append_home): Use "Home"
+       rather than "Username's Home" (#125964).
+       (shortcuts_selection_changed_cb): New callback, check the
+       sensitivity of the Remove Bookmark button at the right time.
+       (shortcuts_row_activated_cb): It is not necessary to check the
+       sensitivity here.
+
 Wed Dec 10 00:06:24 2003  Matthias Clasen  <maclas@gmx.de>
 
        Improve the GDK API for dealing with group leaders (#119375):
index e854fc25a518040c44bc2289bc7ccb93f4da4d76..7b4735dbf9bd00c2855647f6ddb7187928fc704c 100644 (file)
@@ -1,3 +1,12 @@
+2003-12-09  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (shortcuts_append_home): Use "Home"
+       rather than "Username's Home" (#125964).
+       (shortcuts_selection_changed_cb): New callback, check the
+       sensitivity of the Remove Bookmark button at the right time.
+       (shortcuts_row_activated_cb): It is not necessary to check the
+       sensitivity here.
+
 Wed Dec 10 00:06:24 2003  Matthias Clasen  <maclas@gmx.de>
 
        Improve the GDK API for dealing with group leaders (#119375):
index e854fc25a518040c44bc2289bc7ccb93f4da4d76..7b4735dbf9bd00c2855647f6ddb7187928fc704c 100644 (file)
@@ -1,3 +1,12 @@
+2003-12-09  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (shortcuts_append_home): Use "Home"
+       rather than "Username's Home" (#125964).
+       (shortcuts_selection_changed_cb): New callback, check the
+       sensitivity of the Remove Bookmark button at the right time.
+       (shortcuts_row_activated_cb): It is not necessary to check the
+       sensitivity here.
+
 Wed Dec 10 00:06:24 2003  Matthias Clasen  <maclas@gmx.de>
 
        Improve the GDK API for dealing with group leaders (#119375):
index e854fc25a518040c44bc2289bc7ccb93f4da4d76..7b4735dbf9bd00c2855647f6ddb7187928fc704c 100644 (file)
@@ -1,3 +1,12 @@
+2003-12-09  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (shortcuts_append_home): Use "Home"
+       rather than "Username's Home" (#125964).
+       (shortcuts_selection_changed_cb): New callback, check the
+       sensitivity of the Remove Bookmark button at the right time.
+       (shortcuts_row_activated_cb): It is not necessary to check the
+       sensitivity here.
+
 Wed Dec 10 00:06:24 2003  Matthias Clasen  <maclas@gmx.de>
 
        Improve the GDK API for dealing with group leaders (#119375):
index e854fc25a518040c44bc2289bc7ccb93f4da4d76..7b4735dbf9bd00c2855647f6ddb7187928fc704c 100644 (file)
@@ -1,3 +1,12 @@
+2003-12-09  Federico Mena Quintero  <federico@ximian.com>
+
+       * gtk/gtkfilechooserdefault.c (shortcuts_append_home): Use "Home"
+       rather than "Username's Home" (#125964).
+       (shortcuts_selection_changed_cb): New callback, check the
+       sensitivity of the Remove Bookmark button at the right time.
+       (shortcuts_row_activated_cb): It is not necessary to check the
+       sensitivity here.
+
 Wed Dec 10 00:06:24 2003  Matthias Clasen  <maclas@gmx.de>
 
        Improve the GDK API for dealing with group leaders (#119375):
index 24071d107b6983eb104139f5a84d1ae6c4873b08..48c5f04958b845ad4f3ecb24004b5f86f5f250ee 100644 (file)
@@ -1,6 +1,5 @@
 <chapter id="gtk-migrating-GtkFileChooser">
   <chapterinfo>
-    <title>Migrating from GtkFileSelection to GtkFileChooser</title>
     <author>
       <firstname>Federico</firstname>
       <surname>Mena-Quintero</surname>
@@ -12,6 +11,8 @@
     </author>
   </chapterinfo>
 
+  <title>Migrating from GtkFileSelection to GtkFileChooser</title>
+
   <para>
     #GtkFileChooser, starting with GTK+ 2.4, is the new set of APIs
     for file selection widgets and dialogs.  Previous versions of GTK+
index 766111b2001a8642709f0e8d069f550ee6cd9be9..1f837c9f741b23566976263689f0d931e3e2b2e0 100644 (file)
@@ -209,10 +209,10 @@ static void filter_combo_changed       (GtkComboBox           *combo_box,
 static void tree_selection_changed     (GtkTreeSelection      *tree_selection,
                                        GtkFileChooserDefault *impl);
 
-static void     shortcuts_row_activated (GtkTreeView           *tree_view,
-                                        GtkTreePath           *path,
-                                        GtkTreeViewColumn     *column,
-                                        GtkFileChooserDefault *impl);
+static void     shortcuts_row_activated_cb (GtkTreeView           *tree_view,
+                                           GtkTreePath           *path,
+                                           GtkTreeViewColumn     *column,
+                                           GtkFileChooserDefault *impl);
 static gboolean shortcuts_select_func   (GtkTreeSelection      *selection,
                                         GtkTreeModel          *model,
                                         GtkTreePath           *path,
@@ -556,24 +556,18 @@ shortcuts_insert_path (GtkFileChooserDefault *impl,
 static void
 shortcuts_append_home (GtkFileChooserDefault *impl)
 {
-  const char *name;
   const char *home;
   GtkFilePath *home_path;
-  char *label;
   GError *error;
 
-  name = g_get_user_name ();
-  label = g_strdup_printf (_("%s's Home"), name);
-
   home = g_get_home_dir ();
   home_path = gtk_file_system_filename_to_path (impl->file_system, home);
 
   error = NULL;
-  impl->has_home = shortcuts_insert_path (impl, -1, home_path, FALSE, label, &error);
+  impl->has_home = shortcuts_insert_path (impl, -1, home_path, FALSE, _("Home"), &error);
   if (!impl->has_home)
     error_getting_info_dialog (impl, home_path, error);
 
-  g_free (label);
   gtk_file_path_free (home_path);
 }
 
@@ -1060,6 +1054,14 @@ shortcuts_drag_data_received_cb (GtkWidget          *widget,
   g_slist_free (uris);
 }
 
+/* Callback used when the selection in the shortcuts tree changes */
+static void
+shortcuts_selection_changed_cb (GtkTreeSelection      *selection,
+                               GtkFileChooserDefault *impl)
+{
+  bookmarks_check_remove_sensitivity (impl);
+}
+
 /* Creates the widgets for the shortcuts and bookmarks tree */
 static GtkWidget *
 create_shortcuts_tree (GtkFileChooserDefault *impl)
@@ -1093,9 +1095,12 @@ create_shortcuts_tree (GtkFileChooserDefault *impl)
   gtk_tree_selection_set_select_function (selection,
                                          shortcuts_select_func,
                                          impl, NULL);
+
+  g_signal_connect (selection, "changed",
+                   G_CALLBACK (shortcuts_selection_changed_cb), impl);
   
   g_signal_connect (impl->shortcuts_tree, "row-activated",
-                   G_CALLBACK (shortcuts_row_activated), impl);
+                   G_CALLBACK (shortcuts_row_activated_cb), impl);
 
   g_signal_connect (impl->shortcuts_tree, "drag-data-received",
                    G_CALLBACK (shortcuts_drag_data_received_cb), impl);
@@ -2407,10 +2412,10 @@ tree_selection_changed (GtkTreeSelection      *selection,
 
 /* Callback used when a row in the shortcuts list is activated */
 static void
-shortcuts_row_activated (GtkTreeView           *tree_view,
-                        GtkTreePath           *path,
-                        GtkTreeViewColumn     *column,
-                        GtkFileChooserDefault *impl)
+shortcuts_row_activated_cb (GtkTreeView           *tree_view,
+                           GtkTreePath           *path,
+                           GtkTreeViewColumn     *column,
+                           GtkFileChooserDefault *impl)
 {
   GtkTreeIter iter;
   GtkFilePath *model_path;
@@ -2418,8 +2423,6 @@ shortcuts_row_activated (GtkTreeView           *tree_view,
   if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (impl->shortcuts_model), &iter, path))
     return;
 
-  bookmarks_check_remove_sensitivity (impl);
-
   /* Set the current folder */
 
   gtk_tree_model_get (GTK_TREE_MODEL (impl->shortcuts_model), &iter, SHORTCUTS_COL_PATH, &model_path, -1);